name = "candy"
password = "123456"
count = 3
while count:
    user = input("输入用户名称:")
    passwd = input("输入用户密码:")
    if user.strip() == name and password == passwd.strip(): # 这里前后统一一下吧，输入的都放前面或后面
        print("login successfully")
        break
    else:
        print("login failed")
    count -= 1

